home *** CD-ROM | disk | FTP | other *** search
- Path: strauss.udel.edu!not-for-mail
- From: jcorig@strauss.udel.edu (John Pat Corigliano)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: ds.l
- Date: 15 Feb 1996 00:15:58 -0500
- Organization: University of Delaware
- Message-ID: <4fufie$8s7@strauss.udel.edu>
- References: <497.6609T1129T586@mbox3.swipnet.se>
- NNTP-Posting-Host: strauss.udel.edu
-
- In article <497.6609T1129T586@mbox3.swipnet.se>,
- Patrik Nilsson <patrik.nilsson@mbox3.swipnet.se> wrote:
- >When using FileInfoBlock it must be long word aligned.
- >Q: In asm you have 'ds.l'. Is there any equal in C?
-
- You have a few ways:
-
- 1. Use AllocDosObject() - this is guaranteed to be aligned
- properly.
-
- 2. If using SAS, use the __aligned keyword when declaring
- the structure.
-
- 3. I'm fairly certain AllocMem is long-word aligned, but
- I could be wrong...
-
- 4. As a last resort, do it the ugly way :)
-
- UBYTE buffer[sizeof(struct FileInfoBlock) + 3];
- struct FileInfoBlock *fib;
-
- fib = (struct FileInfoBlock *)buffer;
- while ((ULONG)fib & 0x3) ((ULONG)fib)++;
-
- This wastes some memory, but it works ;)
-
- Later,
- --
- John Corigliano jcorig@strauss.udel.edu
- Computer and Information Science University of Delaware
- --
- "Never drive a car when you're dead." - Tom Waits
-